home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / Include / FWRRcShp.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  3.2 KB  |  115 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWRRcShp.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWRRCSHP_H
  11. #define FWRRCSHP_H
  12.  
  13. #ifndef FWSHAPE_H
  14. #include "FWShape.h"
  15. #endif
  16.  
  17. #ifndef FWBNDSHP_H
  18. #include "FWBndShp.h"
  19. #endif
  20.  
  21. #if FW_LIB_EXPORT_PRAGMAS
  22. #pragma lib_export on
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class FW_CLASS_ATTR FW_CGraphicContext;
  30.  
  31. //========================================================================================
  32. //    class FW_CRoundRectShape
  33. //========================================================================================
  34.  
  35. class FW_CLASS_ATTR FW_CRoundRectShape : public FW_CBoundedShape
  36. {
  37. public:
  38.     FW_DECLARE_CLASS
  39.  
  40. //----------------------------------------------------------------------------------------
  41. //    Constructors/Destructors
  42. //
  43. public:
  44.     FW_CRoundRectShape(const FW_CRect& rect,
  45.                       const FW_CPoint& ovalSize,
  46.                       FW_ERenderVerbs renderVerb,
  47.                       const FW_PInk& ink = FW_kNormalInk,
  48.                       const FW_PStyle& style = FW_kNormalStyle);
  49.  
  50.     FW_CRoundRectShape(const FW_CRoundRectShape& other);
  51.     FW_CRoundRectShape(FW_CReadableStream& archive);
  52.     
  53.     virtual ~ FW_CRoundRectShape();
  54.     
  55. //----------------------------------------------------------------------------------------
  56. //    Operators
  57. //
  58. public:
  59.     FW_CRoundRectShape& operator=(const FW_CRoundRectShape& other);
  60.     
  61. //----------------------------------------------------------------------------------------
  62. //    Inherited API
  63. //
  64. public:
  65.     // ----- Hit Testing -----
  66.     virtual FW_Boolean         HitTest(FW_CGraphicContext& gc,
  67.                                         const FW_CPoint& test,
  68.                                         FW_CFixed tolerance) const;
  69.  
  70.     // ----- Copying -----
  71.     virtual FW_CShape*            Copy() const;
  72.     
  73.     // ----- Rendering -----
  74.     virtual void                 Render(FW_CGraphicContext& gc) const;
  75.  
  76.     // ----- Flatten -----
  77.     virtual void                Flatten(FW_CWritableStream& archive) const;
  78.  
  79. //----------------------------------------------------------------------------------------
  80. //    New API
  81. //
  82. public:
  83.     // ----- Rendering -----
  84.     static void                RenderRoundRect(FW_CGraphicContext& gc,
  85.                                                 const FW_CRect& rect, 
  86.                                                 const FW_CPoint& ovalSize,
  87.                                                 FW_ERenderVerbs renderVerb, 
  88.                                                 const FW_PInk& ink = FW_kNormalInk,
  89.                                                 const FW_PStyle& style = FW_kNormalStyle);
  90.  
  91.     // ----- Archiving -----
  92.     static void*                 Read(FW_CReadableStream& archive);
  93.  
  94.     // ----- Geometry -----
  95.     void                        SetGeometry(const FW_CRect& rect, const FW_CPoint& ovalSize);
  96.     void                         GetGeometry(FW_CRect& rect, FW_CPoint& ovalSize) const;
  97.  
  98.     FW_CPoint                    GetOvalSize() const
  99.                                     {return fOvalSize;}    
  100.     void                        SetOvalSize(const FW_CPoint& ovalSize)
  101.                                     {fOvalSize = ovalSize;}
  102.  
  103. //----------------------------------------------------------------------------------------
  104. //    Data Members
  105. //
  106. private:
  107.     FW_CPoint                    fOvalSize;
  108. };
  109.  
  110. #if FW_LIB_EXPORT_PRAGMAS
  111. #pragma lib_export off
  112. #endif
  113.  
  114. #endif
  115.